Combining Register Allocation and Instruction Scheduling
نویسندگان
چکیده
We formulate combined register allocation and instruction scheduling within a basic block as a single optimization problem, with an objective cost function that more directly captures the primary measure of interest in code optimization — the completion time of the last instruction. We show that although a simple instance of the combined problem is NP-hard, the combined problem is much easier to solve approximately than graph coloring, which is a common formulation used for the register allocation phase in phase-ordered solutions. Using our framework, we devise a simple and effective heuristic algorithm for the combined problem. This algorithm is called the ( ; )-Combined Heuristic; parameters and provide relative weightages for controlling register pressure and instruction parallelism considerations in the combined heuristic. Preliminary experiments indicate that the combined heuristic yields improvements in the range of 16-21% compared to the phase-ordered solutions, when the input graphs contain balanced amount of register pressure and instruction-level parallelism. Permanent address: Department of Computer Science, Stanford University, Stanford, CA 94305-2140; +1 (415) 723–6045; [email protected]. Supported by an Alfred P. Sloan Research Fellowship, an IBM Faculty Development Award, an OTL grant, and NSF Young Investigator Award CCR-9357849, with matching funds from IBM, Schlumberger Foundation, Shell Foundation, and Xerox Corporation. Permanent address: Courant Institute of Mathematical Sciences, New York University, 251 Mercer Street, New York, NY 10012-1185; +1 (212) 998–3512; [email protected] Permanent address: Application Development Technology Institute, IBM Software Solutions Division, 555 Bailey Avenue, San Jose, CA 95141; +1 (408) 463–5660; vivek [email protected] Permanent address: Courant Institute of Mathematical Sciences, New York University, 251 Mercer Street, New York, NY 10012-1185; [email protected]
منابع مشابه
Mutation Scheduling : A Uni ed Approach toCompiling for Fine - Grain Parallelism ?
Trade-oos between code selection, register allocation, and instruction scheduling are inherently interdependent, especially when compiling for ne-grain parallel architectures. However, the conventional approach to compiling for such machines arbitrarily separates these phases so that decisions made during any one phase place unnecessary constraints on the remaining phases. Mutation Scheduling a...
متن کاملMutation Scheduling: A Unified Approach to Compiling for Fine-Grain Parallelism
Trade-o s between code selection, register allocation, and instruction scheduling are inherently interdependent, especially when compiling for ne-grain parallel architectures. However, the conventional approach to compiling for such machines arbitrarily separates these phases so that decisions made during any one phase place unnecessary constraints on the remaining phases. Mutation Scheduling a...
متن کاملEffective Instruction Scheduling With Limited Registers
Effective global instruction scheduling techniques have become an important component in modern compilers for exposing more instruction-level parallelism (ILP) and exploiting the everincreasing number of parallel function units. Effective register allocation has long been an essential component of a good compiler for reducing memory references. While instruction scheduling and register allocati...
متن کاملRegister Allocation Instruction Scheduling A New Approach
Instruction scheduling and register allocation are two very In this paper, we solve register allocation and instruction scheduling simultaneously using integer linear programming (ILP). theform ulation?a new ???v ariableU has taken several approaches, including: branch-andbound enumeration (5) (13). more expensive register spill and reload instructions in the program. Eager code This thesis dev...
متن کاملCRAIG: a practical framework for combining instruction scheduling and register assignment
In compilers for machines with instruction-level parallelism, the phases of register assignment and instruction scheduling can be antagonistic. Whichever phase is executed first can have negative effects on the other’s performance. This paper describes a framework, called CRAIG (Combining Register Assignment Interference Graphs), that combines register assignment and instruction scheduling to a...
متن کامل